<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/jquery-3.7.1.js"></script>
</head>
<body>
    <script>
        // 第一：定义对象
        var stu1 = {
            name:'张三',
            age:18,
            sex:'男'
        }

        var stu2 = {
            name:'李四',
            age:28,
            sex:'女'
        }

        var stu3 = {
            name:'王五',
            age:38,
            sex:'男'
        }

        let arr = [stu1,stu2,stu3] ;

        // 第二：循环遍历数组 - 遍历数组下标和元素
       $.each(arr,function(i,obj){
            console.log(i + "：" + obj.name + "-" + obj.sex);
            
       }) ;
       
        
        







    </script>
</body>
</html>